﻿using System;
using System.Collections.Generic;
using System.IO;

namespace _06.SortLines
{
    class SortLines
    {
        static void Main()
        {
            using (StreamReader sr = new StreamReader("List.txt"))
            using (StreamWriter sw = new StreamWriter("SortedList.txt"))
            {
                List<string> list = new List<string>();
                string line = sr.ReadLine();
                while (line != null)
	            {
                    list.Add(line);
                    line = sr.ReadLine();
	            }
                list.Sort();
                
                foreach (var sortedLine in list)
                {
                    sw.WriteLine(sortedLine);
                }
            }
        }
    }
}
